import 'dart:math';
import 'dart:ui' as ui;

import 'dart:ui';

import 'package:flutter/material.dart';

final List<Color> colors = [
  Color(0xFFF60C0C), Color(0xFFF3B913), Color(0xFFE7F716),
  Color(0xFF3DF30B), Color(0xFF0DF6EF), Color(0xFF0829FB),
  Color(0xFFB709F4), ];

final List<double> pos = [ 1.0 / 7, 2.0 / 7, 3.0 / 7, 4.0 / 7, 5.0 / 7, 6.0 / 7, 1.0 ];

Paint getPaint() {
  Paint paint = Paint()..style = PaintingStyle.stroke..strokeWidth = 2;
  paint.shader = ui.Gradient.linear(
    const Offset(0, 0),
    const Offset(100, 0),
    colors,
    pos,
    TileMode.mirror,
    Matrix4.rotationZ(pi / 6).storage, // 旋转变换
  );
  return paint;
}